string getCommand(const char * cmd){
    string retorno;
    FILE * f = popen( cmd , "r" );

    if ( f == 0 ){
        retorno = "-1";
        return retorno;
    }

    const int BUFSIZE = 1000;
    char buf[ BUFSIZE ];

    while( fgets( buf, BUFSIZE,  f ) ) {
        retorno += buf;
    }
    pclose( f );

    return retorno;
}
